function active_bar(name) {
    bar_id_list = ["bar-product-list-li", "bar-product-upload-li", "bar-product-update-li",
        "bar-product-detail-li", "bar-order-list-li", "bar-order-detail-li"]
    for (let i = 0; i < bar_id_list.length; i++) {
        if (bar_id_list[i] === name) {
            document.getElementById(name).classList.add("active");
        } else {
            document.getElementById(bar_id_list[i]).classList.remove("active");
        }
    }
}

function home_page() {
    window.location.href="../../html/seller/index.html";
}

function product_list_page() {
    active_bar("bar-product-list-li");
    $("main").load("element/product-list.html");
}

function product_upload_page() {
    active_bar("bar-product-upload-li");
    $("main").load("element/product-upload.html");
}

function product_update_page(id) {
    product_id = id;
    active_bar("bar-product-update-li");
    $("main").load("element/product-update.html");
}

function product_detail_page(id) {
    product_id = id;
    active_bar("bar-product-detail-li");
    $("main").load("element/product-detail.html");
}

function order_list_page() {
    active_bar("bar-order-list-li");
    $("main").load("element/order-list.html");
}

function order_detail_page() {
    active_bar("bar-order-detail-li");
    $("main").load("element/order-detail.html");
}

function product_vip_page(id) {
    product_id = id;
    $("main").load("element/product-vip.html");
}

